/*
 * Copyright 2020-2030 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package site.syksy.qingzhou.common.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.Set;

/**
 * @author Raspberry
 * 轻舟配置
 */
@ConfigurationProperties(prefix = "qz")
public class QingZhouProperties {

    /**
     * 数据库初始化
     */
    private Boolean dbInit = false;

    /**
     * 安全配置
     */
    private Security security = new Security();

    /**
     * 上传文件目录
     */
    private FileDirectory fileDirectory = new FileDirectory();

    public static class Security {

        /**
         * 全局免登录URL(ANT规则匹配)
         */
        private Set<String> webIgnoring;

        /**
         * API初始化
         */
        private Boolean apiInit = false;

        public Set<String> getWebIgnoring() {
            return webIgnoring;
        }

        public void setWebIgnoring(Set<String> webIgnoring) {
            this.webIgnoring = webIgnoring;
        }

        public Boolean getApiInit() {
            return apiInit;
        }

        public void setApiInit(Boolean apiInit) {
            this.apiInit = apiInit;
        }
    }

    public Boolean getDbInit() {
        return dbInit;
    }

    public void setDbInit(Boolean dbInit) {
        this.dbInit = dbInit;
    }

    public Security getSecurity() {
        return security;
    }

    public void setSecurity(Security security) {
        this.security = security;
    }

    /**
     * 文件目录
     */
    public static class FileDirectory {
        /**
         * tus块文件目录
         */
        private String tusUploadDirectory = "tus-upload-directory";

        /**
         * 应用文件目录
         */
        private String appUploadDirectory = "app-upload-directory";

        public String getTusUploadDirectory() {
            return tusUploadDirectory;
        }

        public void setTusUploadDirectory(String tusUploadDirectory) {
            this.tusUploadDirectory = tusUploadDirectory;
        }

        public String getAppUploadDirectory() {
            return appUploadDirectory;
        }

        public void setAppUploadDirectory(String appUploadDirectory) {
            this.appUploadDirectory = appUploadDirectory;
        }
    }

    public FileDirectory getFileDirectory() {
        return fileDirectory;
    }

    public void setFileDirectory(FileDirectory fileDirectory) {
        this.fileDirectory = fileDirectory;
    }
}
